import {createRouter, createWebHashHistory} from 'vue-router'


// 引入登录页
const Login = ()=> import("../views/Login.vue")

//引入用户中心
const UserCenter = ()=> import("../views/user-center/index.vue");
//引入用户中心的信息页
const UserProfile = ()=> import("../views/user-center/Profile.vue");
//引入用户中心的个人设置页
const UserSettings = () => import("../views/user-center/Settings.vue")

const routes = [
    {
        path:'/',
        component: Login
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    {
        path: '/user',
        name: 'userCenter',
        component: UserCenter,
        redirect: '/user/profile',
        children: [
            {
                path: 'profile',
                name: 'profile',
                component: UserProfile
            },
            {
                path: 'settings',
                name: 'settings',
                component: UserSettings
            },
        ]
    }

]



const router = createRouter({
    history: createWebHashHistory(),
    routes
})



export default router